(function (line) {
    var rWhitespace = ' \n\r\t\f\x0b\xa0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000';
    var StringProto = String.prototype;
    line.extend(line, {
        trimLeft:(function () {
            return StringProto.trimLeft ? function (string) {
                return string.trimLeft();
            } : function (string) {
                for (var i = 0, len = string.length; i < len; i++) {
                    if (rWhitespace.indexOf(string.charAt(i)) === -1) {
                        string = string.substring(i);
                        break;
                    }
                }
                return rWhitespace.indexOf(string.charAt(0)) === -1 ? string : '';
            }
        }()),
        trimRight:(function () {
            return StringProto.trimRight ? function (string) {
                return string.trimRight();
            } : function (string) {
                for (var i = string.length - 1; i >= 0; i--) {
                    if (rWhitespace.indexOf(string.charAt(i)) === -1) {
                        string = string.substring(0, i + 1);
                        break;
                    }
                }
                return rWhitespace.indexOf(string.charAt(0)) === -1 ? string : '';
            }
        }()),
        trim:(function () {
            return StringProto.trim ? function (string) {
                return string.trim();
            } : function (string) {
                return line.trimRight(line.trimLeft(string));
            }
        }())
    });
})(line);